package gui;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
 
class MyDocumentListener implements DocumentListener
{
    public void insertUpdate(DocumentEvent e)
    {
        textChanged("inserted into");
    }
    public void removeUpdate(DocumentEvent e)
    {
        textChanged("removed from");
    }
    public void changedUpdate(DocumentEvent e)
    {
        textChanged("changed");
    }
    public void textChanged(String action)
    {
        System.out.println(action); // do whatever is wanted
    }
}
